package com.spring.business.configure.constants;


import com.spring.starter.LogicErrorCode;

/**
 * 配置错误码
 * @author zhangh
 */
public enum ConfigureErrorCode implements LogicErrorCode
{
	DATA_DOES_NOT_EXIST(8001, "DATA_DOES_NOT_EXIST"),
	FILE_UPLOAD_FAILED(8002, "FILE_UPLOAD_FAILED"),
	FILE_DOWNLOAD_FAILED(8003, "FILE_DOWNLOAD_FAILED"),
	FOLDER_CREATION_FAILED(8004, "FOLDER_CREATION_FAILED"),
	;

	private final int code;
	private final String message;
	private final String toString;

	ConfigureErrorCode(int code, String message)
	{
		this.code = code;
		this.message = message;
		this.toString = "{\"code\":" + code + ",\"message\":\"" + message + "\"}";
	}

	/**
	 * 获取code
	 * @return
	 */
	@Override
	public String code()
	{
		return code + "";
	}

	/**
	 * 获取消息
	 * @return
	 */
	@Override
	public String message()
	{
		return message;
	}
}
